home *** CD-ROM | disk | FTP | other *** search
- package sun.print;
-
- import java.awt.Graphics2D;
- import java.util.ArrayList;
-
- class PrintJob2D$MessageQ {
- private String qid;
- private ArrayList queue;
- // $FF: synthetic field
- final PrintJob2D this$0;
-
- PrintJob2D$MessageQ(PrintJob2D var1, String var2) {
- this.this$0 = var1;
- this.qid = "noname";
- this.queue = new ArrayList();
- this.qid = var2;
- }
-
- synchronized void closeWhenEmpty() {
- while(this.queue != null && this.queue.size() > 0) {
- try {
- this.wait(1000L);
- } catch (InterruptedException var2) {
- }
- }
-
- this.queue = null;
- this.notifyAll();
- }
-
- synchronized void close() {
- this.queue = null;
- this.notifyAll();
- }
-
- synchronized boolean append(Graphics2D var1) {
- boolean var2 = false;
- if (this.queue != null) {
- this.queue.add(var1);
- var2 = true;
- this.notify();
- }
-
- return var2;
- }
-
- synchronized Graphics2D pop() {
- Graphics2D var1 = null;
-
- while(var1 == null && this.queue != null) {
- if (this.queue.size() > 0) {
- var1 = (Graphics2D)this.queue.remove(0);
- this.notify();
- } else {
- try {
- this.wait(2000L);
- } catch (InterruptedException var3) {
- }
- }
- }
-
- return var1;
- }
-
- synchronized boolean isClosed() {
- return this.queue == null;
- }
- }
-